﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Showroom.DAL;
using System.Web;

namespace Showroom.BLL
{
    public class View_Users : _View_Users
    {
        public static View_Users GetUserByID(int id)
        {
            View_Users usr = new View_Users();
            usr.Where.ID.Value = id;
            usr.Query.Load();

            return usr;
        }

        public const string SESSION_USER = "session_user_admin";

        public static View_Users GetCurrentUser()
        {
            return (View_Users)HttpContext.Current.Session[SESSION_USER];
        }

        public static void SetCurrentUser(View_Users u)
        {
            HttpContext.Current.Session[SESSION_USER] = u;
        }
    }
}
